//
//  MqFindBikeBikeRankingTableViewCell.m
//  Meiqi
//
//  Created by lanou on 16/1/21.
//  Copyright © 2016年 KFC. All rights reserved.
//

#import "MqFindBikeBikeRankingTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation MqFindBikeBikeRankingTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 120, 100)];
        //_imageV.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_imageV];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_imageV.right + 10, _imageV.top, kScreenWidth - 150, 30)];
        //_titleLabel.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_titleLabel];
        
        _starLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.left, _titleLabel.bottom + 5, 100, 20)];
        //_starLabel.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_starLabel];
        
        _priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(_starLabel.left, _starLabel.bottom + 5, kScreenWidth - 200, 20)];
        //_priceLabel.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_priceLabel];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_priceLabel.left, _priceLabel.bottom + 5, _priceLabel.width, 20)];
        //_timeLabel.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:_timeLabel];
        
        
    }
    return self;
}


- (void)setModel:(MqFindBikeBikeDetailRankModel *)model
{
    _model = model;
    
    [_imageV sd_setImageWithURL:[NSURL URLWithString:model.photo]];
    _titleLabel.text = model.name;
    
    _priceLabel.text = [NSString stringWithFormat:@"指导价: %@",model.price];
    
    _timeLabel.text = [NSString stringWithFormat:@"年份: %@年",model.publish_year];
    
}






- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
